#pragma once
#include <iostream>
class FileHandler
{
public:
	FileHandler(void);
	~FileHandler(void);

	void LoadFile( char* a_FilePath, char* a_Mode );
	void Close();

	//Template reading
	//template < class T >
	//void Read( T* a_Data );
	//template < class T >
	//void Read( T* a_Data , unsigned int a_Length );
	//Template writing
	template < class T >
	void Write( T* a_Data );
	template < class T >
	void Write( T* a_Data , unsigned int a_Length );
	
	//Short ( 2 bytes )
	void ReadShort( short* a_Data );
	void ReadShort( short* a_Data, unsigned int a_Length );
	void WriteShort( short* a_Data );
	void WriteShort( short* a_Data, unsigned int a_Length );
	//Unsigned short ( 2 bytes )
	void ReadUshort( unsigned short* a_Data );
	void ReadUshort( unsigned short* a_Data, unsigned int a_Length );
	void WriteUshort( unsigned short* a_Data );
	void WriteUshort( unsigned short* a_Data, unsigned int a_Length );
	//Int ( 4 bytes )
	void ReadInt( int* a_Data );
	void ReadInt( int* a_Data, unsigned int a_Length );
	void WriteInt( int* a_Data );
	void WriteInt( int* a_Data, unsigned int a_Length );
	//Unsigned int ( 4 bytes )
	void ReadUint( unsigned int* a_Data );
	void ReadUint( unsigned int* a_Data, unsigned int a_Length );
	void WriteUint( unsigned int* a_Data );
	void WriteUint( unsigned int* a_Data, unsigned int a_Length );	
	//Bytes ( 1 byte )
	void ReadByte( unsigned char* a_Data );
	void ReadByte( unsigned char* a_Data, unsigned int a_Length );
	void WriteByte( unsigned char* a_Data );
	void WriteByte(  unsigned char* a_Data, unsigned int a_Length );
	//Float
	void ReadFloat( float* a_Data );
	void ReadFloat( float* a_Data, unsigned int a_Length );
	void WriteFloat( float* a_Data );
	void WriteFloat( float*	a_Data, unsigned int a_Length );
	//LSTR
	void ReadLSTR( char* a_Data );
	void WriteLSTR();
	//FSTR
	void ReadFSTR( char* a_Data, unsigned int a_Length );
	void WriteFSTR( char* a_Data, unsigned int a_Length );
	//SSTR
	void ReadSSTR( char* a_Data );
	void WriteSSTR( char* a_Data );
	//BSTR
	void ReadBSTR( char* a_Data );
	void WriteBSTR( );

//private:
	FILE* m_File;
	char* m_FileMode;
	int m_Position;
};